from abc import ABC, abstractmethod
from typing import Any, TypeVar

from recruit.adapter.database.models import Base

BaseModel = TypeVar('BaseModel', bound=Base)


class CreatedGateway(ABC):
    @abstractmethod
    async def create(self, *args: Any, **kwargs: Any) -> BaseModel: ...


class ReadingGateway(ABC):
    @abstractmethod
    async def get_one(self, *args: Any, **kwargs: Any) -> BaseModel | None: ...


class UpdatingGateway(ABC):
    @abstractmethod
    async def update(self, *args: Any, **kwargs: Any) -> BaseModel: ...


class DeletedGateway(ABC):
    @abstractmethod
    async def delete(self, *args: Any, **kwargs: Any) -> None: ...
